﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web.Mvc;
using ArunimaErp.Models;

namespace ArunimaErp.Domain
{
    public class UserAccountRepository
    {
        private arunimaEntities db = new arunimaEntities();

        public int GetAccouctId(string UserName)
        {
            my_aspnet_users user = db.my_aspnet_users.SingleOrDefault(u => u.name == UserName);

            int AccountId = db.useraccount.SingleOrDefault(u => u.UserId == user.id && u.Status == 1).AccountId;

            return AccountId;
        }
    }
}